package team.seekers.catering.common.handler.exceptionHandler;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@Data
@AllArgsConstructor//生成有参构造器
@NoArgsConstructor//生成无参构造器
public class ResultException extends RuntimeException{
    //定义异常属性
    private String message;
    //状态码
    private Integer code = 201;

    public ResultException message(String message){
        this.setMessage(message);
        return this;
    }

    public ResultException code(Integer code){
        this.setCode(code);
        return this;
    }
}
